<if condition="$Think.cookie.hidePopupNum eq 1">
    <else />


<style>* {
  line-height: 1em;
}
body {
  margin: 0;
}
.fix-wrap {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  background-color: rgba(0,0,0,0.5);
    display: none;
}
.fix-wrap .content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fix-wrap .content img.abody {
  display: block;
  width: 6.9rem;
  height: 9.09rem;
}
.fix-wrap .content img.close {
  display: block;
  width: 0.64rem;
  height: 0.64rem;
  position: absolute;
  top: 0;
  right: 0;
}
.fix-wrap .content input.phonenum {
  outline: none;
  border: none;
  /* position: absolute; */
  width: 4.5rem;
  height: 0.7rem;
  left: 50%;
  /* margin-left: -2rem; */
  top: 2.65rem;
  font-size: 0.3rem;
}
.fix-wrap .content input.emailnum {
  outline: none;
  border: none;
  /* position: absolute; */
  width: 4.5rem;
  height: 0.7rem;
  left: 50%;
  /* margin-left: -2rem; */
  top: 4.4rem;
  font-size: 0.3rem;
}
.fix-wrap .content .btn {
  left: 50%;
  margin-left: -3.1rem;
  width: 6.2rem;
  height: 1.1rem;
  bottom: 2rem;
  position: absolute;
}
.fix-wrap .content .agr {
  position: absolute;
  width: 0.5rem;
  height: 0.5rem;
  bottom: 1.4rem;
  left: 1.1rem;
}
.fix-wrap .content .agr.hide {
  background: #fff url("__PUBLIC__/images/public/alert2/fang@2x.png") no-repeat center center;
  background-size: 0.31rem 0.3rem;
}
.fix-wrap .content .agr.show {
  background: #fff url("__PUBLIC__/images/public/alert2/fang2@2x.png") no-repeat center center;
  background-size: 0.31rem 0.3rem;
}
.fix-wrap .content .jump{
  position: absolute;
  width: 3rem;
  height: .6rem;
  bottom: .41rem;
}
.inputers{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 6.9rem;
  height: 2.6rem;
  position: absolute;
  left: 0;
  top: 2.5rem;
}
.phonenum-wrap{
  width: 6.3rem;
  height: 1.3rem;
  background:  url("__PUBLIC__/images/public/alert2/dh.png") no-repeat center center;
  background-size: 100% 100%;
  position: relative;
  padding-left: 1.3rem;
  box-sizing: border-box;
  margin-bottom: .2rem;
  padding-top: .05rem;
}
.emailnum-wrap{
  width: 6.3rem;
  height: .82rem;
  background:  url("__PUBLIC__/images/public/alert2/yj.png") no-repeat center center;
  background-size:100% 100%;
  position: relative;
  padding-left: 1.3rem;
  padding-top: .05rem;
  box-sizing: border-box;
}
</style>
<div class="fix-wrap">
  <div class="content"><img class="abody" src="__PUBLIC__/images/public/alert2/tanchaung2z.png"/>
    <div class="inputers">
      <div class="phonenum-wrap">
        <input class='phonenum' type='phone' placeholder="请输入手机号"/>
      </div>
      <div class="emailnum-wrap">
        <input class='emailnum' type='email' placeholder="请输入邮箱"/>
      </div>
    </div>

    <div class="btn"></div>
    <div class="agr show"></div>
    <div class="jump"></div>
  </div>
</div>
<script>
    var phonebindNum="<!--{$phonebindNum}-->";
    var Gphone="<!--{$phone}-->";
    var Gemail="<!--{$email}-->";
    console.log(Gphone);
    var jgOrderUrl="<!--{$jgOrderUrl}-->"
    if(phonebindNum==1&&Gphone==''&&Gemail==''){//显示
         $('.fix-wrap').css('display','flex');$('.com-phone').css('display','flex');$('.com-phone33').css('display','flex');
    }else if(phonebindNum==1&&Gphone==''){
        $('.fix-wrap').css('display','flex');$('.com-phone').css('display','flex');$('.com-phone33').css('display','flex');
        $('.emailnum-wrap').hide();$('.emailnum3-wrap').hide();$('.emailnum33-wrap').hide();
    }else if(phonebindNum==1&&Gemail==''){
        $('.fix-wrap').css('display','flex');$('.com-phone').css('display','flex');$('.com-phone33').css('display','flex');
        $('.phonenum-wrap').hide();$('.udphonenum3-wrap').hide();$('.udphonenum33-wrap').hide();
    }else{
         $('.fix-wrap').hide()
         $('.com-phone').hide()
         $('.com-phone33').hide()
    }

    $('.agr').on('click',function(){
          if(/show/.test($('.agr').attr('class'))){
            $('.agr').attr('class','agr hide')
          }else{
            $('.agr').attr('class','agr show')
          }
  })
$('.btn').on('click',function(){
  var phone = $('input.phonenum').length ? $('input.phonenum').val() :null
  var email = $('input.emailnum').length ? $('input.emailnum').val() :null
  alert2PhoneBind(phone,email)
})
$('.jump').on('click',function(){
    $('.fix-wrap').hide()
})
    function subdata(phone,email){
        $('.fix-wrap').hide()
        $('.com-phone').hide()
        $('.com-phone33').hide()
//        if(!Gphone&&!phone){
//            $('.emailnum-wrap').hide();$('.emailnum3-wrap').hide();$('.emailnum33-wrap').hide();
//        }else if(!Gemail&&!email){
//            $('.phonenum-wrap').hide();$('.udphonenum3-wrap').hide();$('.udphonenum33-wrap').hide();
//        }else{
//        }
      if(!phone){phone='123456';}
      $.getJSON("<!--{:U('Index/updateOrderPhone','',false)}-->",{email:email,phone:phone,jgOrderUrl:jgOrderUrl},function (data) {
          console.log(data);
          if(data.code){
          }else{
              console.log('绑定失败')
          }
      });
    }
    function alert2PhoneBind(phone,email){
      if(phone&&email){
        // 双显
        if(phone && !/^1(3|4|5|6|7|8|9)\d{9}$/.test(phone)){
          alert("手机号码有误，请重填");
        }else if(email && !/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(email)){
          alert("邮箱有误，请重填");
        }else if(!phone &&!email){
          alert("请输入邮箱或者手机号");
        }else{
          subdata(phone,email)
        }
      }else{
        // 单显
        if(phone){
            // 显示手机号
            if(/^1(3|4|5|6|7|8|9)\d{9}$/.test(phone)){
                subdata(phone,'')
            }else{
                alert("手机号码有误，请重填");
            }
        }else if(email){
            // 显示邮箱
            if(/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(email)){
                subdata('',email)
            }else{
                alert("邮箱有误，请重填");
            }
        } else{
            alert("请输入邮箱或者手机号");
        }

      }
    }

    //https://www.cnblogs.com/daxiangxm/p/9509199.html
</script>

</if>